package com.ruoyi.mapper;

import com.ruoyi.domain.vo.CartGoodsDTO;
import com.ruoyi.domain.vo.GoodsVo;
import com.ruoyi.system.domain.OrderInfo;
import com.ruoyi.system.domain.OrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

@Mapper
public interface ExchangeMallMapper {

    List<GoodsVo> selectHotGoodsList(@Param("goodsTypeId") Long goodsTypeId, @Param("offset") Long offset, @Param("pageSize") Long pageSize, @Param("sortWay") String sortWay, @Param("feeShipping") boolean feeShipping);

    List<GoodsVo> selectTimeGoodsList(@Param("goodsTypeId") Long goodsTypeId, @Param("offset") Long offset, @Param("pageSize") Long pageSize, @Param("sortWay") String sortWay, @Param("feeShipping") boolean feeShipping);

    List<Map<String, Object>> selectGoodsTypeList(@Param("typeRemark") String typeRemark);

    void addCart(@Param("goodsId") Long goodsId, @Param("userId") Long userId, @Param("goodsCounts") Long goodsCounts, @Param("stander") String stander);

    boolean isCartExists(@Param("userId") Long userId,@Param("goodsId") Long goodsId);

    void updateCart(@Param("goodsId") Long goodsId,@Param("userId") Long userId);

    void deleteCart(@Param("goodsId") Long goodsId,@Param("userId") Long userId);

    void reduceCartCounts(@Param("goodsId") Long goodsId,@Param("userId") Long userId);

    List<GoodsVo> selectGoodsByName(@Param("goodsName") String goodsName, @Param("offset") Long offset, @Param("pageSize") Long pageSize, @Param("sortWay") String sortWay, @Param("feeShipping") boolean feeShipping);

    GoodsVo selectGoodsVoByGoodsId(@Param("goodsId") Long goodsId);

    void createOrderInfo(OrderInfo orderInfo);

    void createOrderItem(@Param("orderId") Long orderId, @Param("cartGoodsDTO") CartGoodsDTO cartGoodsDTO);

    void createOrderItemRelate(@Param("orderId") Long orderId, @Param("relateGoodsId") String relateGoodsId);

    List<Map<String, Object>> selectOrderShop(Long orderId);

    List<OrderItem> selectOrderItemByOrderId(Long orderId);

    void payOrderUpdateOrderItem(@Param("orderItemId") Long orderItemId, @Param("usePoints") Double usePoints, @Param("transFee") Double transFee, @Param("arrivalTime") String arrivalTime, @Param("shippingMethods") String shippingMethods);

    void payOrderUpdateOrderInfo(@Param("orderId") Long orderId, @Param("orderPrice") Double orderPrice, @Param("defaultAddress") Map<String, Object> defaultAddress, @Param("payWay") String payWay, @Param("orderDeductPoint") Double orderDeductPoint);

    void updateUserPoint(@Param("userId") Long userId, @Param("usePoints") Double usePoints);

    void updateGoodsInventory(@Param("goodsId") Long goodsId, @Param("goodsCounts") Long goodsCounts);

    void createOrderItemNow(@Param("orderId") Long orderId, @Param("goodsId") Long goodsId, @Param("goodsCounts") Long goodsCounts, @Param("goodsPrice") String goodsPrice, @Param("goodsDiscount") String goodsDiscount, @Param("stander") String stander);

    List<Map<String, Object>> selectOrderList(Long orderId);
}
